package com.huilian.iotbox.admin.wap.controller;

import com.huilian.iotbox.admin.wap.service.RegionService;
import com.huilian.iotbox.data.common.ServerResponse;
import com.huilian.iotbox.data.po.Region;
import com.huilian.iotbox.data.vo.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author 謝洛涛
 * @date 2020/4/15 9:58
 */
@RestController
@RequestMapping("/api/region")
public class RegionController extends UserInfoController {
    @Autowired
    private RegionService regionService;
    @GetMapping("/findRegionList")
    public ServerResponse findRegionList(Region region, HttpServletRequest request){
        UserInfo userInfo = super.getLoginUserInfo(request);
        return regionService.findRegionList(region);
    }
}
